package com.nbsaas.boot.vipcard.data.entity;

import com.nbsaas.boot.code.annotation.FormAnnotation;
import com.nbsaas.boot.code.annotation.FormField;
import com.nbsaas.boot.code.annotation.InputType;
import com.nbsaas.boot.code.annotation.SearchItem;
import com.nbsaas.boot.jpa.data.entity.AbstractEntity;
import lombok.Data;
import org.hibernate.annotations.Comment;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Table;
import java.math.BigDecimal;


@Data
@FormAnnotation(title = "会员卡管理", menu = "1,76,81",searchWidth = "100",viewWidth = "100")
@Entity
@Table(name = "bs_vip_card_template")
public class VipCardTemplate extends AbstractEntity {


    @Comment("会员卡名称")
    @SearchItem(label = "会员卡名称",name = "name")
    @FormField(title = "会员卡名称", grid = true,required = true,col = 22)
    private String name;

    @Comment("会员卡标识")
    @SearchItem(label = "会员卡标识",name = "key")
    @Column(name = "data_key")
    @FormField(title = "会员卡标识",grid = true,required = true,col = 22)
    private String key;

    @Comment("会员卡类型")
    @FormField(title = "会员卡类型",grid = true,required = true,col = 22,type = InputType.dictionary)
    private Integer cardType;

    @Comment("有效期限")
    @FormField(title = "有效期限",grid = true,required = true,col = 22,type = InputType.dictionary)
    private Integer expiryType;


    @Comment("数量")
    @Column(name = "nums")
    @FormField(title = "数量", grid = true,col = 22,ignore = true)
    private Long memberNum;

    @Comment("卡封面")
    @FormField(title = "卡封面",type = InputType.image,col = 22)
    private String logo;

    /**
     * 卡片背景
     */
    @Comment("卡背景")
    @FormField(title = "卡背景",type = InputType.image,col = 22)
    private String background;


    /**
     * 卡的优先级
     */
    @Comment("卡的优先级")
    private Integer priority;

    @Comment("原价")
    @FormField(title = "原价",col = 7)
    private BigDecimal money;

    @Comment("优惠价")
    @FormField(title = "优惠价",col = 7)
    private BigDecimal discount;

    @Comment("推荐提成")
    @FormField(title = "推荐提成",col = 7)
    private BigDecimal backMoney;

    @Comment("折扣")
    @FormField(title = "折扣",col = 7)
    private BigDecimal rebate;

    @Comment("到期天数")
    @FormField(title = "天数", col = 7,type = InputType.el_input_number)
    private Integer day;

    @Comment("会员权益")
    @FormField(title = "会员权益",width = "1000",grid = true,type = InputType.textarea,col = 22)
    private String note;

    @Comment("备注")
    @FormField(title = "备注",width = "1000",type = InputType.textarea,col = 22)
    private String demo;
}
